package com.coincalf.wallet.blockchain;

public enum ChainErrorEnum {

	UNKNOWN_ERROR("80000", "UNKNOWN_ERROR", "遇到了未知的异常"),
	INSUFFICIENT_ACCOUNT_FUNDS_ERROR("80001", "INSUFFICIENT_ACCOUNT_FUNDS", "账户资金不足"),
	ACCOUNT_ADDRESS_ERROR("80002","ACCOUNT_ADDRESS_ERROR", "帐号地址错误"),
	TRANSACTION_FAILURE_ERROR("80003", "TRANSACTION_FAILURE_ERROR", "交易失败"),
	TRANSACTION_AMOUNT_SMALL_ERROR("80004", "TRANSACTION_AMOUNT_SMALL_ERROR", "交易金额太少"),
	TRANSACTION_ID_ERROR("80005", "TRANSACTION_ID_ERROR", "交易ID错误"),
	ADDRESS_FORMAT_ERROR("80006", "ADDRESS_FORMAT_ERROR", "地址格式错误"),
	ETH_GAS_NOT_ENOUGH_ERROR("80007", "ETH_GAS_NOT_ENOUGH_ERROR", "ETH手续费不足"),
	USDT_UTXO_BALANCE_INSUFFICIENT("99999", "USDT_UTXO_BALANCE_INSUFFICIENT", "USDT地址BTC手续费不足"),
	GET_PRIVATE_KEY_ERROR("123456", "GET_PRIVATE_KEY_ERROR", "交易签名失败"),	//实际错误是获取私钥失败
	GET_NONCE_ERROR_BY_RPC("123457", "GET_NONCE_ERROR_BY_RPC", "获取NONCE失败"),
	SEND_RAW_TRANSACTION_ERROR("123458", "SEND_RAW_TRANSACTION_ERROR", "区块交易失败"),
	RPC_QUERY_ERROR("123459", "RPC_QUERY_ERROR", "RPC查询失败"),
	GET_GAS_PRICE_ERROR("123462", "GAS PRICE ERROR", "获取gas price失败"),
	TX_SIGN_ERROR("123463", "TX SIGN ERROR", "交易签名失败"),
	GAS_NOT_ENOUGH_ERROR("80008", "GAS_NOT_ENOUGH_ERROR", "手续费不足"),
	AES_DECRYPT_ERROR("123465", "AES_DECRYPT_ERROR", "AES工具类解密异常"),
	AES_ENCRYPT_ERROR("123466", "AES_ENCRYPT_ERROR", "AES工具类加密异常"),
	IO_EXCEPTION("123467", "IO_EXCEPTION", "交易上链失败"),
	NONCE_TOO_LOW("123469", "NONCE_TOO_LOW", "发送交易太频繁，请稍后再试"),
	TRAINS_AMOUNT_TOO_LOW("123470", "TRAINS_AMOUNT_TOO_LOW", "THIS IS A DUST"),
	FEE_ADDRESS_AMOUNT_INSUFFICIENT("123471", "FEE_ADDRESS_AMOUNT_INSUFFICIENT", "手续费地址BTC余额不足"),
	FROM_AMOUNT_INSUFFICIENT("123472", "FROM_AMOUNT_INSUFFICIENT", "请确保USDT地址至少有546聪BTC"),
	GAS_PRICE_TOO_LOW("123477", "GAS_PRICE_TOO_LOW", "gas价格设置过低")
	;
	private final String code;
	private final String errorCode;
	private final String message;

	ChainErrorEnum(String code, String errorCode, String message) {
		this.code = code;
		this.errorCode = errorCode;
		this.message = message;
	}

	public String getCode() {
		return code;
	}

	public String getErrorCode() {
		return errorCode;
	}

	public String getMessage() {
		return message;
	}

}
